﻿@{
    ResFile = "cms_Media";
}
<div class="mediaPropertiesContainer g-clear">
    <div id="selectMediaFolderContainer" class="g-clear">
        @Html.Action("selectmedia", "cmsmedia", new { id = ViewBag.MediaContentId })
    </div>
    <br />
    <div id="createMediaContentContainer">
        <div style="display:none;" data-bind="visible: mediaFileModel.files().length > 0">
            <ul class="b-mediaFileContainer" data-bind='template: { name: "fileRowTemplate", foreach: mediaFileModel.files, afterRender:function(){ PubSub.publish($.cmsAdminEvents.registeredEvents.UpdateImages); } }'></ul>
        </div>
    </div>
</div>

<script type="text/html" id="fileRowTemplate">
    <li class="b-assets-item g-clear" data-bind="css: { selected: selected }">
        <a class="b-mediaFileContainer__item__link" href="#" data-bind="click: function() {viewModel.mediaFileModel.select($data); selected(!selected()); animateInQueue();}, attr: { rel: fileId}">
            <span class="title" data-bind="text: fileName"></span> 
            <div class="img-container">
                <img data-bind="attr: { alt: fileName, src: linkedFileName}" />  
            </div>
        </a>
        <div class="b-form-outer" style="display:none;" data-bind="fadeVisible: selected">
            <fieldset class="b-form">
    	        <ol class="b-form__rows ul-reset g-clear">
                    <li class="b-form__row g-clear">
        	            <label>@_("Media content name")</label>
                        <input class="text" type="text" data-bind="value: name" />
                    </li>
                    <li class="b-form__row g-clear">
        	            <label>@_("Hide from search engines")</label>
                        <input type="checkbox" value="True" data-bind="checked: blockFromSearchEngines" />
                    </li>
                    <li class="b-form__row g-clear">
        	            <label>@_("Description")</label>
                        <textarea class="text" rows="5" cols="20" data-bind="value: description"></textarea>
                    </li>
                    <li class="b-form__row g-clear">
                        <label>@_("Content tags")</label>
                        <select multiple="multiple" class="mediaContentTag" data-placeholder="@_("Add tags")" data-bind="options: allTags, optionsText: 'TagName', optionsValue: 'Id', selectedOptions: tags"></select>                    
                    </li>
                    <li class="b-form__row b-form__row_buttons g-clear">
                        <input type="hidden" data-bind="value: fileId" />  
		                <input class="b-button b-button_colour_grey" name="btnClear" type="submit" value="@_("Clear")" data-bind="click: viewModel.mediaFileModel.clearContent" />        	
                    </li>
                </ol>
            </fieldset>
        </div>
    </li>        
</script>

